home *** CD-ROM | disk | FTP | other *** search
- ; *** Total Football HD loader v1.0
- ; *** Written by Jean-François Fabre
-
- include "jst.i"
-
- HD_PARAMS "",0,0
-
- loader:
- Mac_printf "Total Football AGA HD Loader v1.0"
- Mac_printf "Coded by Jean-François Fabre © 2000"
-
- JSRABS Test2MBChip
- tst.l D0
- bne MemErr
-
- TESTFILE chipname
- tst.l d0
- bne FileErr
-
- JSRABS LoadFiles
-
- moveq.l #0,D0
- move.l #CACRF_CopyBack,D1
- JSRABS Degrade
-
- GO_SUPERVISOR
- SAVE_OSDATA $200000
-
- JSRGEN FreezeAll
- move #$2700,SR
-
- bsr InstallBoot
-
- ; **** boot stuff and patch
-
- JSRGEN FlushCachesHard
-
- move.l start_address(pc),-(A7)
- rts
-
- InstallBoot:
- ; read program file
-
- lea chipname(pc),A0
- lea $19268,A1
- RELOC_MOVEL A1,start_address
- moveq.l #0,D0
- moveq.l #-1,D1 ; whole file
- JSRGEN ReadFile
-
- ; check the file CRC
-
- lea $19268,A0
- move.l D1,D0
- JSRGEN CRC16
- cmp.w #$2A49,D0
- bne.b RTWrongVersion
-
- ; read routine
-
- PATCHUSRJMP $1B642,ReadFile
-
- ; quit key
-
- PATCHUSRJSR $1957E,KbInt
-
- ; configure memory
-
- lea $100,A0
- MOVEA.L $4,A6 ;034: 2C7900000004
- MOVE #$FF,758(A0) ; attnflags?
- MOVE.L #$200000,760(A0) ; top chip
- MOVE.L #$0,764(A0) ; top fast
-
- rts
-
- KbInt:
- move.b $BFEC01,D0
- STORE_REGS D0
- ror.b #1,D0
- not.b D0
- cmp.b #$5F,D0
- bne.b .skip
- JSRGEN InGameExit
- .skip
- RESTORE_REGS D0
- rts
-
- ReadFile:
- STORE_REGS
- move.l A2,A1
- moveq.l #0,D0
- moveq.l #-1,D1
- JSRGEN ReadFile
- tst.l D0
- bne RTFileErr
- RESTORE_REGS
- JMP $1BBC8
-
- RTWrongVersion:
- lea PrintWrongVersion(pc),A0
- JSRGEN SetExitRoutine
- JSRGEN InGameExit
- bra RTWrongVersion
-
- RTFileErr:
- lea PrintFileErr(pc),A0
- JSRGEN SetExitRoutine
- JSRGEN InGameExit
- bra RTFileErr
-
- PrintFileErr:
- Mac_printf "** File(s) missing!"
- rts
- PrintWrongVersion:
- Mac_printf "** Unsupported or unknown version!"
- rts
-
- FileErr:
- bsr PrintFileErr
- JMPABS CloseAll
-
- MemErr:
- Mac_printf "** The loader needs an AGA Amiga"
- JMPABS CloseAll
-
- trainer:
- dc.l 0
-
- start_address:
- dc.l 0
-
- chipname:
- dc.b "CHIPRAM.EXE",0
- fastname:
- dc.b "FASTRAM.EXE",0
-